package com.wzt.org.service.impl;

import com.wzt.base.service.impl.BaseServiceImpl;
import com.wzt.org.domain.Department;
import com.wzt.org.service.IDepartmentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * @author Zenith
 */
@Service
public class DepartmentServiceImpl extends BaseServiceImpl<Department>
        implements IDepartmentService {

    @Override
    @Transactional(rollbackFor = {})
    public void addOne(Department department) {
        department.setCreate_time(new Date());
        super.addOne(department);
    }

    @Override
    @Transactional(rollbackFor = {})
    public void editOne(Department department) {
        department.setUpdate_time(new Date());
        super.editOne(department);
    }

    @Override
    public void loadTree() {
        System.out.println("获取部门树");
    }
}
